package com.jinzht.tools;

import java.util.HashMap;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@EnableScheduling
@Component
public class FlightTrainTask {
	//产生利息
	@Scheduled(cron = "30 45 23 * * ?")
	public void taskCycle() {
		String url = "http://localhost:8080/hengfengapp/manager/ScheduledProfile.action";
		System.out.println("使用SpringMVC框架配置定时任务");
		HttpClientHelper.get(url, new HashMap());
	}
	
	
	//备份数据库
	@Scheduled(cron = "30 50 23 * * ?")
	// 间隔5秒执行
	public void backUpDataBase() {
		String url = "http://localhost:8080/hengfengapp/manager/BackUpDataBase.action";
		System.out.println("使用SpringMVC框架配置定时任务");
		HttpClientHelper.get(url, new HashMap());
	}

	//汇款
	@Scheduled(cron = "0 0/1 * * * ?")
	// 间隔5秒执行
	public void batchSettle() {
		String url = "http://localhost:8000/hengfengapp/manager/auditOrderRecords.action";
		System.out.println("使用SpringMVC框架配置定时任务");
		HttpClientHelper.get(url, new HashMap());
	}
}
